// @FileName  :bar.c
// @Time      :2024/2/29 23:31
// @Author    :YKW
//# include <bits/stdc++.h>
//using namespace std;
#include <stdio.h>
#include <ctype.h> // 用于tolower函数

#define MAX_CHAR_COUNT 100 // 假设最多字符出现次数不会超过100

void main() {
    int char_count[26];
    char ch;
    for(int i=0;i<26;i++) char_count[i]=0;
    while ((ch = getchar()) != EOF)
        char_count[ch - 'a']++;
    int max_count = 0;
    for (int i = 0; i < 26; i++)
        if (char_count[i] > max_count)
            max_count = char_count[i];
    for (int i = max_count; i > 0; i--) {
        for (int j = 0; j < 26; j++) {
            if (char_count[j] >= i)
                printf("*");
            else
                printf(" ");
        }
        printf("\n");
    }
    for (int i = 0; i < 26; i++)printf("%c", 'a' + i);
    return 0;
}